/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package JFreeChartExtensions.chartsExporters;

import JFreeChartExtensions.chartsExporters.impl.IChartExporter;
import JFreeChartExtensions.chartsExporters.impl.PDFChartExporter;
import JFreeChartExtensions.chartsExporters.impl.PNGChartExporter;
import JFreeChartExtensions.utils.DataFileFilter;

/**
 *
 * @author Nobody
 */
public class ChartExportBuilder {

    public static final String PDF = "pdf";
    public static final String PNG = "png";

    public IChartExporter build(DataFileFilter dataFileFilter) {
        if (dataFileFilter.extensions[0].equals(PNG)) {
            return new PNGChartExporter();
        } else if (dataFileFilter.extensions[0].equals(PDF)) {
            return new PDFChartExporter();

        } else {
            throw new IllegalStateException("there is no exporter for ." + dataFileFilter.extensions[0] + " type");
        }
    }
}
